<template>
	<div>
		<div>
			<button @click="add">add</button>
		</div>
		<ul>
			<li v-for="item in arr0">{{item}}</li>
		</ul>
	</div>
</template>
<script type="text/javascript">
	export default {
		name:"TestArray",
		data(){
			return {
				arr0:["zu1","zu2"],
				arr1:[],
				arr2:[]
			}
		},
		methods:{
			add(){
				// this.arr0.fill(2,1,6);//用2，替换1-6，fill不触发渲染，不增加长度
				this.arr0[2]="ccc";
				this.arr0=[...this.arr0];//生效
				console.log(this.arr0);
			}
		}
	}
</script>

<style type="text/css" lang="less" scoped>
	ul{
		display: flex;
	}
	li{
    background-color:#ccc;
    margin:0 5px;
	}
</style>